﻿@using CodeCamp.Models.Shared
@model CodeCamp.Models.Email.MailBasicViewModel

@{
    ViewBag.Title = "";
    if ((@Model != null) && (@Model.EventDisplayName != null))
    {
        ViewBag.Title = @Html.Encode(@Model.EventDisplayName + " | Email Sent");
    }
    else
    {
        ViewBag.Title = "Code Camp | Email Email";
    }
}

<h2>Email Sent</h2>

@if (!string.IsNullOrWhiteSpace(Model.ErrorMessage))
{
    <h3>@Model.ErrorMessage</h3>
}
@if (Model.MailModel != null)
{
<text>To: </text>@Model.MailModel.EmailTo<br />
<text>Subject: </text><br />
    if (!string.IsNullOrWhiteSpace(Model.MailModel.ParentContext))
    {
        switch (Model.MailModel.ParentContext)
        {
            case "CampaignList":
                if (Model.MailModel.EmailCampaignId.HasValue)
                {
                    @Html.ActionLink("Back to Campaign List", "EmailCampaignEmailList", new { eventName = Model.EventShortName, id = Model.MailModel.EmailCampaignId.Value }) <br />
                }
                break;
            case "RecentEmails":
                    @Html.ActionLink("Back to Recent Emails List", "RecentEmails", new { eventName = Model.EventShortName }) <br />
                break;
        }
    }
}

@section sidebar {
    @if (User.IsInRole(CCRoles.RoleNames.BigCheeze))
    {
    <div id="eventTagsContainer" class="widget rounded-10">
    <ul>
        <li>@Html.ActionLink("Back to Email Home", "Index")</li>
        <li>@Html.ActionLink("Campaigns", "EmailCampaigns")</li>
        <li>@Html.ActionLink("Recent Emails", "RecentEmails")</li>
        <li>
            Email Tests:
            <ul>
                <li>@Html.ActionLink("Basic Test", "TestBasicMail")</li>
            </ul>
        </li>
    </ul>
    </div>
    }
}
